package edu.cuit.avatar.loop;

import java.util.Scanner;

public class RepeatAdditionQuiz {
    public static void main(String[] args) {
        int number1 = (int)(Math.random() * 10);
        int number2 = (int)(Math.random() * 10);

        System.out.printf("%d + %d = ",number1, number2);
        Scanner input = new Scanner(System.in);
        int answer = input.nextInt();

        while(answer != number1 + number2){
            System.out.printf("%d + %d = ",number1, number2);
            //迭代部分
            answer = input.nextInt();
        }
        input.close();
    }
}
